<div ng-include src="'tpl/public/header.html'"></div> 
<div class="contents">
  <ol class="breadcrumb" ng-if="false">
    <li><a href="#/index/panel">首页</a></li>
    <li><a href="#/product/list">产品列表</a></li>
    <li><a href="#/product/view?id={{project.id}}">{{project.pName}}</a></li>
    <li class="active">附件管理</li>
  </ol>
  <div class="row">
    <div class="col-xs-7">
    <table class="table table-striped table-hover ">
      <thead>
        <tr>
          <th width="">文件</th>
          <th width="100">操作</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="attach in attachs" ng-click="edit($index)">
          <td><a ng-href="{{staticHost}}{{attach.fPath}}" target="_blank">{{attach.fName }}</a></td>
          <td class="optd">
            <a class="cur-p" ng-click="edit($index)" has-auth where="btn" who="PRODUCT_ATTACH_UPDATE" owner="{{project.createBy}}">编辑</a>
            <a class="cur-p" ng-click="deleteItem($index)" has-auth where="btn" who="PRODUCT_ATTACH_UPDATE" owner="{{project.createBy}}">删除</a>
          </td>
        </tr>
      </tbody>
    </table>
    </div>
   
    <form class="form-horizontal col-xs-5" role="form" name="form" ng-submit="save()" novalidate has-auth where="btn" who="PRODUCT_UPDATE_SALEPROCESS" owner="{{project.createBy}}"> 
      <div class="form-group">
        <label for="advertTitleInput" class="col-sm-2 control-label">产品名称</label>
        <div class="col-sm-5 form-control-text">{{project.pName}}</div>
      </div> 
      <div class="form-group" ng-class="{'has-error':form.fName.$invalid }">
        <label for="advertLinkInput" class="col-sm-2 control-label">文件名</label>
        <div class="col-sm-5">
          <input type="text" class="form-control" id="advertLinkInput" placeholder="文件名" name="fName" ng-model="item.fName" required="required">
        </div>
      </div>
      <div class="form-group" ng-class="{'has-error':form.fileUrl.$invalid}">
        <label class="col-sm-2 control-label">附件地址(pdf)</label>
        <div class="col-sm-5">
          <input type="text" class="form-control" placeholder="附件地址" name="fileUrl" ng-model="item.fileUrl" required="required">
          <div class="btn btn-primary add-pic-btn">上传附件</div>
        </div>
      </div> 
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-5">
          <button type="submit" class="btn btn-default">提交</button>
        </div>
      </div>
    </form>
  </div>

	<div class="pager-box" ng-include src="'tpl/public/pager.html'" ng-show="ads.length > 0"></div>
</div>
<div load-script src="'/static/jquery.jUploader-1.01.js?5'" call-back="" charset="utf-8" ></div>
